package com.tsc.design.strategyMode.example;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: chentl
 * @Date: 2025/09/17/20:59
 * @Description:
 */
public class PaymentExample {

    public static void main(String[] args) {
        ShoppingCart shoppingCart = new ShoppingCart();

        shoppingCart.setPaymentStrategy(new AlipayPayment("123456789"));
        shoppingCart.pay(100);
        System.out.println("--------------------------------------------------");

        shoppingCart.setPaymentStrategy(new CreditCardPayment("张三", "123456789"));
        shoppingCart.pay(100);
        System.out.println("--------------------------------------------------");

        shoppingCart.setPaymentStrategy(new WechatPayment("123456789"));
        shoppingCart.pay(100);

    }
}
